<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
 * Created on 2012-7-14
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
?>
<script>
		$(function(){
				$('.replay_span').click(function(){
						var $id = $(this).attr('id');
						var $action = $('#replay_form').val();
						$('#replay_article').appendTo($(this).parents('div .comment_content'));
						$('#replay_article form').attr('action',$action+'/'+$id);						
					})			
		})
</script>
<div id="comment">
	<p Id='comment_title'><?php echo $comments_num;?> 个 评论：</p>
	<?php $i=1;foreach($comments as $comment):?>

	<div class='comment_container'>
		<div class="comment_userinfo">
		  <ul>
		    <li><img src='<?php echo base_url();?>/files/images/default.jpg' alt='username'/><br/>
		    </li>
		    <li><?php echo $comment->username;?><br/>
		    </li>
		  </ul>
		</div>
		<div class='comment_content'>
		  <ul>
		    <li class='comment_layer'><?php echo $comment->date;?>  #<?php echo $i;$i++?><br/>
		    </li>
		    <li><?php echo $comment->content;?><br/>
		    </li>
		    <li class='comment_replay' ><span class='replay_span' id='<?php echo $comment->id;?>'>回复</span> <br/>
		    </li>
		  </ul>
		</div>
	</div>
	<?php endforeach;?>
</div>